load("@fbcode_macros//build_defs:rust_library.bzl", "rust_library")
load("@fbsource//tools/build_defs:glob_defs.bzl", "glob")

oncall("buck2")

rust_library(
    name = "buck2_wrapper_common",
    srcs = glob(["src/**/*.rs"]),
    os_deps = [
        (
            "linux",
            [
                "fbsource//third-party/rust:nix",
            ],
        ),
        (
            "macos",
            [
                "fbsource//third-party/rust:nix",
            ],
        ),
        (
            "windows",
            [
                "fbsource//third-party/rust:winapi",
            ],
        ),
    ],
    test_deps = [
        "fbsource//third-party/rust:serde_json",
        "//buck2/app/buck2_util:buck2_util",
    ],
    deps = [
        "fbsource//third-party/rust:anyhow",
        "fbsource//third-party/rust:once_cell",
        "fbsource//third-party/rust:serde",
        "fbsource//third-party/rust:shlex",
        "fbsource//third-party/rust:sysinfo",
        "fbsource//third-party/rust:thiserror",
        "fbsource//third-party/rust:uuid",
        "//buck2/allocative/allocative:allocative",
        "//buck2/gazebo/dupe:dupe",
    ],
)
